// 导航栏
let lis = document.querySelectorAll('.lia');
let uls = document.querySelectorAll('.uls');
for (let i = 0; i < lis.length; i++) {
    lis[i].addEventListener('mouseover', function() {
        // @ts-ignore
        uls[i].style.display = 'block';
    })
};
for (let i = 0; i < lis.length; i++) {
    lis[i].addEventListener('mouseout', function() {
        uls[i].style.display = 'none';
    })
};
// 导航栏固定
let navs = document.querySelector('.nav');

window.addEventListener('scroll', function() {
        let h = document.documentElement.scrollTop

        if (navs.offsetTop < h) {
            console.log(1);
            navs.style.position = 'fixed';
            navs.style.top = 0;

        } else {
            console.log(2);

            navs.style.position = '';

        }
    })
    // 表格
let tables = [{
    code: '0603',
    Specialty: '电子商务',
    people: '200',
    system: '三年',
    person: '孙老师',
    go: '立即报名'
}, {
    code: '0301',
    Specialty: '计算机应用与维修',
    people: '120',
    system: '三年',
    person: '孙老师',
    go: '立即报名'
}, {
    code: '0604',
    Specialty: '会计',
    people: '100',
    system: '三年',
    person: '孙老师',
    go: '立即报名'
}, {
    code: '1102',
    Specialty: '建筑施工',
    people: '100',
    system: '三年',
    person: '孙老师',
    go: '立即报名'
}, {
    code: '0519',
    Specialty: '酒店管理',
    people: '100',
    system: '三年',
    person: '孙老师',
    go: '立即报名'
}];
let tbodys = document.querySelector('.tbody1');
for (var i = 0; i < tables.length; i++) {
    let trs = document.createElement('tr');
    // console.log(i);

    trs.innerHTML = `<td>${tables[i].code}</td>
                <td>${tables[i].Specialty}</td>
                <td>${tables[i].people}</td>
                <td>${tables[i].system}</td>
                <td>${tables[i].person}</td>
                <td>
                    <a href="">${tables[i].go}</a>
                </td>`;
    // @ts-ignore
    tbodys.appendChild(trs);
};
// 表单2
let tables2 = [{
    code: '0603',
    Specialty: '电子商务',
    people: '200',
    system: '一年',
    person: '孙老师',
    go: '立即报名'
}, {
    code: '0301',
    Specialty: '计算机应用与维修',
    people: '120',
    system: '一年',
    person: '孙老师',
    go: '立即报名'
}, {
    code: '0604',
    Specialty: '会计',
    people: '100',
    system: '一年',
    person: '孙老师',
    go: '立即报名'
}, {
    code: '1102',
    Specialty: '建筑施工',
    people: '100',
    system: '一年',
    person: '孙老师',
    go: '立即报名'
}, {
    code: '0519',
    Specialty: '酒店管理',
    people: '100',
    system: '一年',
    person: '孙老师',
    go: '立即报名'
}];
let tbodys2 = document.querySelector('.tbody2');
for (var i = 0; i < tables2.length; i++) {

    let trs2 = document.createElement('tr');
    trs2.innerHTML = `<td>${tables2[i].code}</td>
                <td>${tables2[i].Specialty}</td>
                <td>${tables2[i].people}</td>
                <td>${tables2[i].system}</td>
                <td>${tables2[i].person}</td>
                <td>
                    <a href="">${tables2[i].go}</a>
                </td>`;
    // @ts-ignore
    tbodys2.appendChild(trs2);
};